 <?php
    $cs=Yii::app()->clientScript;
    $baseUrl=$this->module->assetsUrl;
    $cs->registerCssFile($baseUrl.'/css/bui-min.css');
    $cs->registerCssFile($baseUrl.'/css/dpl-min.css');
    $cs->registerCssFile($baseUrl.'/css/main-min.css');    
    $cs->registerCssFile($baseUrl.'/css/global.css');    
    $cs->registerScriptFile($baseUrl.'/js/admin.js',CClientScript::POS_HEAD);
    //Yii::app()->log->routes[0]->enabled?Yii::app()->log->routes[0]->enabled=false:'';
    ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh" xml:lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<title><?php echo $this->pageTitle;?>-后台管理</title>
</head>
<body>
	<div class="header">

		<div class="dl-title">
			后台管理系统
			<!--<img src="/chinapost/Public/assets/img/top.png">-->
		</div>

		<div class="dl-log">
			欢迎您，<span class="dl-log-user"><?php echo Yii::app()->user->name;?></span><a
				href="<?php echo $this->createUrl('default/logout');?>" title="退出系统"
				class="dl-log-quit">[退出]</a>
		</div>
	</div>
	<div class="content">
		<div class="dl-main-nav">
			<div class="dl-inform">
				<div class="dl-inform-title">
					<s class="dl-inform-icon dl-up"></s>
				</div>
			</div>
			<ul id="J_Nav" class="nav-list ks-clear">
                <?php 
                $role_auth = Yii::app()->user->get_auth_power();
                $role_auth_keys = array_keys($role_auth);
                foreach($menu as $v){ 
					if(in_array(Yii::app()->user->id,Yii::app()->params['administrator']) || in_array($v['menu_id'], $role_auth_keys)){
					?>
	                <li class="nav-item dl-selected"><div class="nav-item-inner nav-home"><?php echo $v['menu_name'] ?></div></li>
	                <?php 
					}
		        }?>

			</ul>
		</div>
		<ul id="J_NavContent" class="dl-tab-conten">

		</ul>
	</div>
    <div id="iframe_load">
    	<img src="<?php echo $baseUrl;?>/img/wait.gif" alt="加载中" />
        <span>加载中…</span>
    </div>
  <?php
    $cs->registerScriptFile($baseUrl.'/js/bui-min.js',CClientScript::POS_HEAD);
    $cs->registerScriptFile($baseUrl.'/js/common/main-min.js',CClientScript::POS_HEAD);
    $cs->registerScriptFile($baseUrl.'/js/config-min.js',CClientScript::POS_HEAD);
    $cs->registerScriptFile($baseUrl.'/js/admin-main.js',CClientScript::POS_END);
  ?>
  <script>
      BUI.use("<?php echo $baseUrl .'/js/common/main'?>" ,function(){
          var objectMenu = <?php echo json_encode($leftmenu);?>;
          var config = objectMenu;
         // var config = [{id:'1',menu:[{text:'系统管理',items:[{id:'12',text:'机构管理',href:'Node/index.html'},{id:'3',text:'角色管理',href:'Role/index.html'},{id:'4',text:'用户管理',href:'User/index.html'},{id:'6',text:'菜单管理',href:'Menu/index.html'}]}]},{id:'7',homePage : '9',menu:[{text:'业务管理',items:[{id:'9',text:'查询业务',href:'Node/index.html'}]}]}];
          new PageUtil.MainPage({
        	modulesConfig : config
          });
     });
  </script>
 </body>
</html>
